<?php

namespace app\admin\validate;

use \think\Validate;

/**
 *  商品价格验证器
 */
class SellerProductPrice extends Validate
{
    protected $rule = [
        'id' => 'require|number',
        'pageIndex' => 'require|number',
        'pageSize' => 'require|number',
        'model_id' => 'require|number',
        'start_date' => 'require|date',
        'end_date' => 'require|date'
    ];

    //定义验证提示
    protected $message = [
        'id.require' => 'ID不能为空',
        'id.number' => 'ID参数错误',
        'pageIndex.require' => '页码参数不能为空',
        'pageIndex.number' => '页码参数错误',
        'pageSize.require' => '分页条数不能为空',
        'pageSize.number' => '分页条数参数错误',
        'start_date.require' => '开始日期不能为空',
        'start_date.date' => '开始日期格式错误',
        'end_date.require' => '结束日期不能为空',
        'end_date.date' => '结束日期格式错误',
        'model_id.require' => '矿机型号ID不能为空',
        'model_id.number' => '矿机型号ID参数错误'
    ];

    protected $scene = [
        'getList' => ['pageIndex','pageSize'],
        'getTrend' => ['model_id','start_date','end_date']
    ];
}
